export const formConfig = {
	inline: false,
	showBtn: true,
	labelPosition: 'top',
	labelWidth: '120px',
	column: [
		{
			label: '提前预警天数',
			prop: 'days',
			type: 'input',
			span: 24,
			rules: [{ required: true, message: '请输入提前预警天数' }],
		},
		{
			label: '启用状态',
			prop: 'status',
			type: 'select',
			dicData: [
				{
					label: '启用',
					value: 1,
				},
				{
					label: '禁用',
					value: 2,
				},
			],
			rules: [{ required: true, message: '请选择启用状态' }],
			span: 24,
		},
	],
}

export const searchConfig = {
	inline: true,
	showBtn: true,
	labelPosition: 'left',
	column: [
		{
			label: '提前预警天数',
			prop: 'days',
			type: 'input',
			span: 8,
		},
		{
			label: '启用状态',
			prop: 'status',
			type: 'select',
			dicData: [
				{
					label: '启用',
					value: 1,
				},
				{
					label: '禁用',
					value: 2,
				},
			],
			span: 8,
		},
		{
			label: '创建时间',
			prop: 'createTimeBetween',
			type: 'dateBetween',
			valueFormat: 'YYYY-MM-DD HH:mm:ss',
			span: 8,
		},
	],
}

export const tableConfig = {
	stripe: true,
	border: true,
	columns: [
		{ label: '提前预警天数', prop: 'days' },
		{
			label: '启用状态',
			prop: 'status',
			custome: 'tag',
			dicData: [
				{
					label: '启用',
					value: 1,
					type: 'success',
				},
				{
					label: '禁用',
					value: 2,
					type: 'danger',
				},
			],
			span: 8,
		},
		{ label: '创建人', prop: 'createUserName' },
		{ label: '创建时间', prop: 'createTime' },
		{
			label: '操作',
			prop: 'menu',
			width: 300,
			fixed: 'right',
		},
	],
}

export const api = {
	index: 'view_setExpiryWarningRules_page',
	add: 'view_setExpiryWarningRules_add',
	edit: 'view_setExpiryWarningRules_edit',
	delete: 'view_setExpiryWarningRules_del',
}
export const baseConfig = {
	pageName: '到期预警规则',
	dictcodes: [],
	rowKey: 'id',
	addLabel: '新增',
	tipLabel: 'days',
	exportMqTopic: '/ning/export/',
	api,
	auth: api,
	paramsObj: {},
	menuBtn: [
		{
			icon: 'editor',
			label: '编辑',
			type: 'primary',
			operate: 'edit',
			auth: api.edit,
			text: true,
			show: true,
		},
		{
			icon: 'detail',
			label: '详情',
			type: 'primary',
			operate: 'detail',
			auth: api.index,
			text: true,
			show: true,
		},
		{
			icon: 'delete',
			label: '删除',
			type: 'danger',
			operate: 'delete',
			auth: api.delete,
			text: true,
			show: true,
		},
	],
	dialogConfig: {
		width: '55%',
	},
	searchConfig,
	formConfig,
	tableConfig,
	detailConfig: formConfig,
}
